{template 'header', 'member'}
<script type="text/javascript">c(3);</script>
<div class="tinfo">
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="add"><a href="link.php?action=add"><span>添加链接</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="s3"><a href="link.php"><span>已发布<span class="px10">({$nums[3]})</span></span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="s2"><a href="link.php?status=2"><span>审核中<span class="px10">({$nums[2]})</span></span></a></td>
</tr>
</table>
</div>
{if $action=='add'}
<form method="post" action="link.php" id="dform" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<table cellpadding="6" cellspacing="1" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> 网站名称</td>
<td class="tr"><input name="post[title]" type="text" id="title" size="40" /> {dstyle('post[style]')} <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 链接地址</td>
<td class="tr"><input type="text" size="40" name="post[linkurl]" id="linkurl" value="http://"/> <span id="dlinkurl" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">显示顺序</td>
<td class="tr"><input name="post[listorder]" type="text" id="listorder" size="5" value="0"/>  <span id="dlistorder" class="f_red"></span> 填写数字,数字越大越靠前</td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 确 定 " class="sBtn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" 重 置 " class="sBtn"/></td>
</tr>
</table>
</form>
<script type="text/javascript">s('link');m('add');</script>
{elseif $action=='edit'}
<form method="post" action="link.php" id="dform" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
<table cellpadding="6" cellspacing="1" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> 网站名称</td>
<td class="tr"><input name="post[title]" type="text" id="title" size="40" value="{$title}"/>  {dstyle('post[style]', $style)} <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 链接地址</td>
<td class="tr"><input type="text" size="40" name="post[linkurl]" id="linkurl" value="{$linkurl}"/> <span id="dlinkurl" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">显示顺序</td>
<td class="tr"><input name="post[listorder]" type="text" id="listorder" size="5" value="{$listorder}"/>  <span id="dlistorder" class="f_red"></span> 填写数字,数字越大越靠前</td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 修 改 " class="sBtn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 返 回 " class="sBtn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
{load('clear.js')}
<script type="text/javascript">s('link');m('s{$status}');</script>
{else}
<form action="link.php">
<input type="hidden" name="status" value="{$status}"/>
<div class="tt">
&nbsp;<input type="text" size="60" name="kw" value="{$kw}" title="关键词"/> &nbsp;
<input type="submit" value=" 搜 索 " class="sBtn"/>&nbsp;
<input type="button" value=" 重 置 " class="sBtn" onclick="Go('link.php?status={$status}');"/>
</div>
</form>
</div>
<div class="con">
<table cellspacing="0" cellpadding="0" class="tb">
<tr>
<th>链接名称</th>
<th>网站地址</th>
<th>添加时间</th>
<th width="40">修改</th>
<th width="40">删除</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td><a href="{$v[linkurl]}" target="_blank">{$v[title]}</a></td>
<td><a href="{$v[linkurl]}" target="_blank">{$v[linkurl]}</a></td>
<td class="f_gray">{$v[adddate]}</td>
<td><a href="link.php?action=edit&itemid={$v[itemid]}"><img width="16" height="16" src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/edit.png" title="修改" alt=""/></a></td>
<td><a href="link.php?action=delete&itemid={$v[itemid]}" onclick="if(!confirm('确定要删除吗？此操作将不可撤销')) return false;"><img width="16" height="16" src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/delete.png" title="删除" alt=""/></a></td>
</tr>
{/loop}
</table>
</div>
{if $MG[link_limit]}
<div class="limit">总共可发 <span class="f_b f_red">{$MG[link_limit]}</span> 条&nbsp;&nbsp;&nbsp;当前已发 <span class="f_b">{$limit_used}</span> 条&nbsp;&nbsp;&nbsp;还可以发 <span class="f_b f_blue">{$limit_free}</span> 条</div>
{/if}
<div class="pages">{$pages}</div>
<script type="text/javascript">s('link');m('s{$status}');</script>
{/if}
{if $action=='add' || $action=='edit'}
<script type="text/javascript">
function check() {
	if(Dd('title').value == '') {
		Dmsg('请填写网站名称', 'title');
		return false;
	}
	if(Dd('linkurl').value.length < 15) {
		Dmsg('请填写网站地址', 'linkurl');
		return false;
	}
	return true;
}
</script>
{/if}
</div></div></div>
{template 'footer'}